package com.antu.first.enums;

/**
 * Created by Administrator on 2018/3/13.
 */
public enum HotelStateEnum {
    UPDATE_SUCCESS(0,"更新成功！"),UPDATE_FAILED(-1,"更新失败！"),EMPTY_IMAGE(-101,"传入的图片为空"),EMPTY_ADDR(-102, "图片地址为空！");

    private int state;

    private String stateInfo;

    HotelStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {

        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public static HotelStateEnum valueOf(int key){
        for(HotelStateEnum stateEnum : values()){
            if(stateEnum.getState() == key){
                return stateEnum;
            }
        }
        return null;
    }

}
